package com.winspread.app.hitl.binds

import com.winspread.app.hitl.room.Book
import com.winspread.app.hitl.room.BookDao
import javax.inject.Inject
import javax.inject.Named

/**
 *Author: Amin
 *Data: 2022/4/19 11:06
 *
 *Description:
 *
 */
class BookImpl @Inject constructor() : IBook {

    @Inject
    @field:[Named("BOOK")]
    lateinit var bookDao: BookDao

    override suspend fun saveBook(name: String) {
        bookDao.insertAll(Book(name))
    }

    override suspend fun getBookAllSum(): Int {
        return bookDao.queryBookAll()
    }
}